package com.hourses.service.impl;

import com.hourses.mapper.RoleAuthMapper;
import com.hourses.pojo.Result;
import com.hourses.service.RoleAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @Author:LiTao
 * @Date:2025/4/30 15:41
 */
@Service
public class RoleAuthServiceImpl implements RoleAuthService {

    //根据roleId删除roleAuth表中对应的数据
    @Autowired
    private RoleAuthMapper roleAuthMapper;
    @Override
    public Result deleteByRoleId(Integer roleId) {
        Integer count = roleAuthMapper.deleteByRoleId(roleId);
        if (count>0){
            return Result.ok("删除成功！");
        }
        return Result.err(Result.CODE_ERR_BUSINESS,"删除失败！请联系管理员...");
    }
}
